#include<iostream>
using namespace std;
#include<vector>
#include<unordered_map>
class Solution {
public:
    int countCompleteDayPairs(vector<int>& hours) {
        unordered_map<int, int> map;
        int ans = 0;
        for (auto& e : hours) {
            int now = e % 24;
            if (map.count((24 - now) % 24))
                ans += map[(24 - now) % 24];
            ++map[now];
        }
        return ans;
    }
};